package b4.view.component.humanBeing
{
	import b4.view.component.smithy.BoxObj;
	
	import org.aswing.ASColor;
	import org.aswing.BorderLayout;
	import org.aswing.FlowLayout;
	import org.aswing.JLabel;
	import org.aswing.JPanel;
	import org.aswing.SoftBoxLayout;
	import org.aswing.border.LineBorder;
	
	public class HumanProperty extends HumanBaseTab
	{
		public var leftPaneNorth:JPanel;
		public var leftPaneSouth:JPanel;
		public var leftPaneWest:JPanel;
		public var leftPaneCenter:JPanel;
		public var leftPaneEast:JPanel;
		
		public var leftPaneTopLable:JLabel;
		
		public var headDec:BoxObj; 
		public var necklace:BoxObj;
		public var belt:BoxObj;
		public var ringLeft:BoxObj;
		public var ringRight:BoxObj;
		
		public var weapon:BoxObj;
		public var clouse:BoxObj;
		public var wrist:BoxObj;
		public var accessories:BoxObj;//配饰；
		public var bracelet:BoxObj;//手镯
		
		public var 	talisman:BoxObj;//法宝
		public var shoes:BoxObj;//
		public var escorting:BoxObj;//护驾
		public var equipmentArr:Array;
		
		public function HumanProperty()
		{
			leftPane.setLayout(new BorderLayout());
			leftPane.setBorder(new LineBorder(null, ASColor.BLACK));
			leftPaneNorth = new JPanel(new FlowLayout(FlowLayout.RIGHT));
			leftPaneNorth.setBorder(new LineBorder(null, ASColor.BLACK));
			leftPaneSouth = new JPanel(new FlowLayout(FlowLayout.LEFT, 34, 0, false));
			leftPaneSouth.setBorder(new LineBorder(null, ASColor.BLACK));
			leftPaneSouth.setPreferredHeight(50);
			leftPaneWest = new JPanel(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, 10));
			leftPaneWest.setBorder(new LineBorder(null, ASColor.BLACK));
			leftPaneWest.setPreferredWidth(42);
			leftPaneEast = new JPanel(new SoftBoxLayout(SoftBoxLayout.Y_AXIS, 10));
			leftPaneEast.setBorder(new LineBorder(null, ASColor.BLACK));
			leftPaneEast.setPreferredWidth(42);
			leftPaneCenter = new JPanel();
			leftPaneCenter.setBorder(new LineBorder(null, ASColor.BLACK));
			leftPane.append(leftPaneNorth, BorderLayout.NORTH);
			leftPane.append(leftPaneSouth, BorderLayout.SOUTH);
			leftPane.append(leftPaneCenter, BorderLayout.CENTER);
			leftPane.append(leftPaneWest, BorderLayout.WEST);
			leftPane.append(leftPaneEast, BorderLayout.EAST);
			leftPaneTopLable = new JLabel("职业      " + "战士");
			leftPaneNorth.append(leftPaneTopLable);
	
			headDec = new  EquipmentBoxObj("头饰", 0); 		
			necklace = new EquipmentBoxObj("项链",  1); 
			belt = new EquipmentBoxObj("腰带", 2); 
			ringLeft = new EquipmentBoxObj("戒指", 3); 
			ringRight = new EquipmentBoxObj("戒指", 4); 
			leftPaneWest.appendAll(headDec, necklace, belt, ringLeft);

			weapon = new EquipmentBoxObj("武器", 5);
			clouse = new EquipmentBoxObj("衣服", 6); 
			wrist = new EquipmentBoxObj("护腕", 7); 
			accessories = new EquipmentBoxObj("配饰",8); //配饰；
			bracelet = new EquipmentBoxObj("手镯", 9); //手镯
			leftPaneEast.appendAll(weapon, clouse, wrist, accessories);
			
			talisman = new EquipmentBoxObj("法宝", 10); //法宝
			shoes = new EquipmentBoxObj("鞋",11);//
			escorting = new EquipmentBoxObj("护驾", 12); //护驾	
			equipmentArr = new Array();
			equipmentArr.push(headDec, necklace, belt, ringLeft, ringRight,weapon,clouse,wrist,accessories,bracelet,talisman,shoes,escorting);
			leftPaneSouth.append(ringRight, FlowLayout.LEFT);
			leftPaneSouth.append(bracelet, FlowLayout.RIGHT);
			leftPaneSouth.appendAll(talisman, shoes, escorting);
			
			addProperties(rightPane, "体力  ", 3);
			addProperties(rightPane, "生命  ", 3);
			addProperties(rightPane, "攻击  ", 3);
			addProperties(rightPane, "防御  ", 3);
			addProperties(rightPane, "法力  ", 3);
			addProperties(rightPane, "敏捷  ", 3);
			addProperties(rightPane, "闪避  ", 3);
			addProperties(rightPane, "士气  ", 3);
			addProperties(rightPane, "魅力  ", 3);
			addProperties(rightPane, "战斗力", 3);
		}
		
		private function addProperties(pane:JPanel, title:String, num:int):void
		{
			pane.append(new JLabel(title + "     " + num));
		}
		
	}
}
